package com.crrc.yzt.demo.utils

import android.content.Context
import android.os.Build
import android.os.LocaleList
import java.util.Locale

object AppUtils {



    fun toChinaLocal( context: Context){
        val config = context.resources.configuration.apply {
            setLocale(Locale.getDefault())
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                setLocales(LocaleList(Locale.getDefault()))
            }
        }
        context.createConfigurationContext(config)
    }

    fun toKoreaLocal( context: Context){
        val config = context.resources.configuration.apply {
            setLocale(Locale.KOREA)
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                setLocales(LocaleList(Locale.KOREA))
            }
        }
        context.createConfigurationContext(config)
    }



}